<template>
	<view class="index">
		<view class="list" v-for="(item, key) in list" :key="key" v-text="item.name" @click="goForm(item)"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {}
		},
		computed: {
			list() {
				return this.$store.state.typesList
			}
		},
		methods: {
			goForm(row) {
				this.$store.commit('setCurrentType', row)
				uni.navigateTo({
					url: '/pages/index/form'
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	@import '../../common/style/main.less';
	.index {
		height: 100%;
		display: flex;
		flex-flow: column;
		justify-content: center;
		align-items: center;
		overflow: auto;
		.list {
			margin: 30rpx 0;
			width: 80%;
			background-color: @main-color;
			color: #ffffff;
			border-radius: 20rpx;
			padding: 20rpx 0;
			text-align: center;
		}
	}
</style>
